package com.centsuse.my_redis.es.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.util.Date;
import java.util.List;

/**
 * @author bobo
 */
@Document(indexName = "document_index", writeTypeHint = WriteTypeHint.FALSE)
public class DocumentEntity {

    // ES文档ID，由Elasticsearch自动生成
    @Id
    private String id;

    @Field(name = "task_id", type = FieldType.Keyword)
    private String taskId;

    @Field(name = "file_id", type = FieldType.Keyword)
    private String fileId;

    @Field(name = "kn_title", type = FieldType.Text, analyzer = "ik_max_word")
    private String knTitle;

    @Field(name = "summary", type = FieldType.Text, analyzer = "ik_max_word")
    private String summary;

    @Field(name = "content", type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(name = "part_id", type = FieldType.Keyword)
    private String partId;

    @Field(name = "vectorized_flag", type = FieldType.Boolean)
    private Boolean vectorizedFlag;

    @Field(name = "secene_codes", type = FieldType.Keyword)
    private List<String> seceneCodes;

    @Field(name = "visiable_tags", type = FieldType.Keyword)
    private List<String> visiableTags;

    @Field(name = "usage_tags", type = FieldType.Keyword)
    private List<String> usageTags;

    @Field(name = "source_departments", type = FieldType.Keyword)
    private List<String> sourceDepartments;

    @Field(name = "source_system", type = FieldType.Keyword)
    private String sourceSystem;

    @Field(name = "cutomized_tags", type = FieldType.Keyword)
    private List<String> cutomizedTags;

    @Field(name = "create_time", type = FieldType.Date, format = DateFormat.date_optional_time)
    private Date createTime;

    @Field(name = "update_time", type = FieldType.Date, format = DateFormat.date_optional_time)
    private Date updateTime;

    @Field(name = "is_published", type = FieldType.Boolean)
    private Boolean isPublished;

    @Field(name = "kn_type", type = FieldType.Integer)
    private Integer knType;

    @Field(name = "latest_flag", type = FieldType.Boolean)
    private Boolean latestFlag;

    @Field(name = "del_flag", type = FieldType.Boolean)
    private Boolean delFlag;

    // 构造函数
    public DocumentEntity() {
    }

    // Getter和Setter方法
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getKnTitle() {
        return knTitle;
    }

    public void setKnTitle(String knTitle) {
        this.knTitle = knTitle;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getPartId() {
        return partId;
    }

    public void setPartId(String partId) {
        this.partId = partId;
    }

    public Boolean getVectorizedFlag() {
        return vectorizedFlag;
    }

    public void setVectorizedFlag(Boolean vectorizedFlag) {
        this.vectorizedFlag = vectorizedFlag;
    }

    public List<String> getSeceneCodes() {
        return seceneCodes;
    }

    public void setSeceneCodes(List<String> seceneCodes) {
        this.seceneCodes = seceneCodes;
    }

    public List<String> getVisiableTags() {
        return visiableTags;
    }

    public void setVisiableTags(List<String> visiableTags) {
        this.visiableTags = visiableTags;
    }

    public List<String> getUsageTags() {
        return usageTags;
    }

    public void setUsageTags(List<String> usageTags) {
        this.usageTags = usageTags;
    }

    public List<String> getSourceDepartments() {
        return sourceDepartments;
    }

    public void setSourceDepartments(List<String> sourceDepartments) {
        this.sourceDepartments = sourceDepartments;
    }

    public String getSourceSystem() {
        return sourceSystem;
    }

    public void setSourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
    }

    public List<String> getCutomizedTags() {
        return cutomizedTags;
    }

    public void setCutomizedTags(List<String> cutomizedTags) {
        this.cutomizedTags = cutomizedTags;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Boolean getIsPublished() {
        return isPublished;
    }

    public void setIsPublished(Boolean isPublished) {
        this.isPublished = isPublished;
    }

    public Integer getKnType() {
        return knType;
    }

    public void setKnType(Integer knType) {
        this.knType = knType;
    }

    public Boolean getLatestFlag() {
        return latestFlag;
    }

    public void setLatestFlag(Boolean latestFlag) {
        this.latestFlag = latestFlag;
    }

    public Boolean getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Boolean delFlag) {
        this.delFlag = delFlag;
    }
}